#include <stdio.h>

#define STR_LENGTH 10010
#define ASCII_LENGTH 128

int main()
{
    char s1[STR_LENGTH], s2[STR_LENGTH];
    fgets(s1, STR_LENGTH, stdin);
    fgets(s2, STR_LENGTH, stdin);

    int ascii[ASCII_LENGTH] = {0};
    for (char* p = s2; *p != '\n'; p++) {
        int value = *p;
        ascii[value]++;
    }
    
    for (char* p = s1; *p != '\n'; p++) {
        int value = *p;
        if (ascii[value] == 0) {
            printf("%c", *p);
        }
    }
}